#-------------------------------------------------------------------------------
# Name:        module2
# Purpose:
#
# Author:      Student
#
# Created:     17/07/2012
# Copyright:   (c) Student 2012
# Licence:     <your licence>
#-------------------------------------------------------------------------------

def main():


    name = "juanita"
    strlist = list(name)
    wronglettersUsed = ""
    numberofguesses = 9
    guessesMade = 0
    correctguesses = 0
    lettersTried = ""
    while(numberofguesses > guessesMade and guessesMade < len(name)):
        print
        print
        print

        print("letters used: " + wronglettersUsed + " # " + str(numberofguesses - guessesMade) + " guesses left")
        print
        print

        user_input = raw_input("Guess a letter:")
        user_input = user_input.strip()
        user_input = user_input.lower()
        guessesMade = guessesMade + 1
        if user_input in strlist:
            print(user_input +" is correct but still have " + str(len(name) - guessesMade) + " more letters to find")
            ocurrences = name.count(user_input)
            correctguesses = correctguesses + ocurrences
        else:
            lettersTried = lettersTried + user_input
            wronglettersUsed = wronglettersUsed + user_input
            print(user_input +" is wrong but still have " + str(len(name) - guessesMade) + " guesses left")
            print(wronglettersUsed)
    else:


        print
        print
        print

        if(guessesMade >= numberofguesses):
            print("Too Bad loser... Only had " + str(correctguesses) +" correct answers")
            print("The word was juanita :)")
        else:
            print("Good Job..You are so cool. How did you know that the answer was " + name + " ?!?")



if __name__ == '__main__':
    main()
